var unit = require('../../../common/script/util');
Page({
    data: {
        orientationIndex: 0,
        orientationList: ["东", "南", "西", "北", "东西", "南北", "东南", "东北", "西南", "西北"],
        houseTypeIndex: 0,
        houseTypeList: [],
        assetTypeIndex: 0,
        assetTypeList: [],
        specialFactorsIndex: 0,
        specialFactorsList: [],
        loading: true,
        btnDis: true
    },
    onLoad: function onLoad(options) {
        var that = this;
        wx.request({
            url: 'http://localhost:8080/wxAppletOpportunity/getListInfo',
            data: {},
            method: 'POST',
            header: {
                'content-type': 'application/json'
            },
            success: function success(res) {
                that.setData({
                    houseTypeList: res.data.houseTypeList,
                    assetTypeList: res.data.assetTypeList,
                    specialFactorsList: res.data.specialFactorsList,
                    loading: false,
                    btnDis: false
                });
            }
        });
        var params = JSON.parse(options.params);
        this.setData({
            city: params.city,
            district: params.district,
            projectName: params.projectName
        });
    },
    addOrientation: function addOrientation(e) {
        this.setData({
            orientationIndex: e.detail.value
        });
    },
    addAssetType: function addAssetType(e) {
        this.setData({
            assetTypeIndex: e.detail.value
        });
    },
    addHouseType: function addHouseType(e) {
        this.setData({
            houseTypeIndex: e.detail.value
        });
    },
    addSpecialFactors: function addSpecialFactors(e) {
        this.setData({
            specialFactorsIndex: e.detail.value
        });
    },
    createStep4: function createStep4(e) {
        wx.navigateTo({
            url: '../createStep4/createStep4?params=' + JSON.stringify(e.detail.value)
        });
    }
});